//
//  Person.m
//  20507
//
//  Created by student on 16/3/23.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "Person.h"

@implementation Person
static Person *instance=nil;
+(instancetype)allocWithZone:(struct _NSZone *)zone
{
    @synchronized(self) {
        if(instance==nil)
        {
            instance=[super allocWithZone:zone];
        }
    }
    return instance;
}
+(Person *)sharePerson
{
    @synchronized(self) {
        if(instance==nil)
        {
            instance=[[Person alloc]init];
        }
    }
    return instance;
}
-(id)copyWithZone:(nullable NSZone *)zone
{
    return instance;
}
@end
